home *** CD-ROM | disk | FTP | other *** search
- Sub MAIN
- REM Begin macro
-
- On Error Goto Quit
- REM If error occurs, go to Quit
- REM subroutine
-
- PageView = ViewPage()
- REM Define ViewPage function with
- REM current values as "PageView"
-
- Rough = ViewDraft()
- REM Define ViewDraft function with
- REM current values as "Rough"
-
- ViewDraft - 1
- REM Turn draft mode on
-
- OKChar$ = ".:!?"
- REM Period, colon, exclamation, and
- REM question defined in char string
-
- LOG = - 1
- REM When text found, extend select once
- REM to left
-
- InsertBookmark .Name = "Here"
- REM Insert a Bookmark with the name
- REM "Here"
-
- On Error Goto Break
- REM If an error occurs go to Break
- REM subroutine
-
- StartOfDocument
- REM Go to beginning of document
-
- While LOG = - 1
- REM As long as search is successful...
-
- EditSearch .Search = "? ", .WholeWord = 0, .MatchCase = 0, .Direction = 2, .Format = 0
-
- REM ...do not look for whole word or
- REM matched upper and lower case,
- REM search toward end of document, and
- REM ignore formatting
-
- If SelType() <> 2 Then Goto Break
- REM If selected text is not solid, to
- REM Break subroutine
-
- LOG = EditSearchFound()
- REM Define EditSearchFound function as
- REM "LOG"
-
- If InStr(OKChar$, Left$(Selection$(), 1)) = 0 Then
- REM If a period or colon is not found
- REM to left of selected source text,
- REM then...
-
- CharLeft 1 : CharRight 1 : CharRight 1, 1
- REM ...extend selection once to left,
- REM once to right, then right again
-
- Reply = MsgBox("Remove extra space ?", "Double space", 3)
- REM Define MsgBox function with message
- REM and title, including Yes, No, and
- REM Cancel buttons as "Reply"
-
- If Reply = - 1 Then
- REM If Yes button chosen...
-
- EditClear - 1
- REM ...delete the selected text from
- REM one char to left of insertion point
-
- ElseIf Reply = 1 Then
- REM Otherwise, if Cancel button
- REM chosen...
-
- Goto Quit
- REM ...go to Quit subroutine
-
- End If
- REM End the current If subroutine
-
- CharLeft 1
- REM Move the cursor once to the left
-
- End If
- REM End this If subroutine
-
- Wend
- REM End While subroutine
-
- Break:
- REM "Break" subroutine
-
- EditGoTo .Destination = "Here"
- REM Move cursor to "Here" Bookmark
-
- InsertBookmark .Name = "Here", .Delete
- REM Delete Bookmark
-
- Quit:
- REM "Quit" subroutine
-
- If PageView Then ViewPage PageView
- REM If in ViewPage mode, return to that
- REM mode
-
- If Not Rough Then ViewDraft Rough
- REM If not in draft mode, go to draft
- REM mode
-
- End Sub
- REM End macro